﻿using Microsoft.Xna.Framework.GamerServices;
using RaptorEngine;
using RaptorEngine.Managers;

namespace OilRigSumoWrestlers.Scenes.Network
{
    class JoinGame : Scene
    {
        public JoinGame(bool network) : base(network)
        {
        }
        public override void Update()
        {
            if (Gamer.SignedInGamers.Count == 1)
            {
                GameEngine.Instance.Network.State = NetworkManager.NetworkState.Joining;
                GameEngine.Instance.Scene.HideCurrentScene();
                GameEngine.Instance.Scene.StopCurrentScene();
                GameEngine.Instance.Scene.RemoveCurrentScene();
                GameEngine.Instance.Scene.PushScene(new Lobby(false));
                GameEngine.Instance.Scene.StartCurrentScene();
                GameEngine.Instance.Scene.ShowCurrentScene();
            }
            else
            {
                GameEngine.Instance.Network.State = NetworkManager.NetworkState.Login;
            }
        }
    }
}
